package 如何初始化数组;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class 数组反转13 {
    public static void main(String[] args) {
        ArrayList a = new ArrayList();
        for (int i = 0; i < 6; i++) {
            a.add((int) (Math.random() * 100));
            System.out.println("随机数=>" + a);
        }
        System.out.println("反转前" + a);
        Collections.reverse(a);
        System.out.println("反转后" + a);
    }
}